package system

import (
	"server/global"
)

type SysPermission struct {
	global.GvaModel
	ID             uint             `gorm:"column:id;primaryKey;autoIncrement;comment:权限ID" json:"id"`
	ParentId       uint             `gorm:"column:parent_id;comment:父级权限ID"       json:"parent_id"`
	Name           string           `gorm:"column:name;index:idx_name;comment:权限定义名"            json:"name" binding:"required"`
	DisplayName    string           `gorm:"column:display_name;comment:权限显示名"    json:"display_name" binding:"required"`
	Description    string           `gorm:"column:description;comment:权限描述"     json:"description"`
	OrderNum       uint             `gorm:"column:order_num;comment:排序数字，值越小越靠前"       json:"order_num" binding:"min=0"`
	IsPublic       bool             `gorm:"column:is_public;comment:是否为公共权限,1:公共权限,0:授权权限"       json:"is_public"`
	IsOperationLog bool             `gorm:"column:is_operation_log;comment:是否记录操作日志" json:"is_operation_log"`
	Children       []*SysPermission `gorm:"-" json:"children" binding:"-"` //子菜单列表
}
